﻿package com.ufenlei.LTS {
	import com.ufenlei.LTS.TestingRadio;
	import flash.events.Event;
	
	/**
	 * @author bbn
	 */
	public class TestingImageRadio extends TestingRadio {
		private var imageLoader:ImageLoader;
		public function TestingImageRadio(lbl : String, idx : int = 0, de : Boolean = false, lck : Boolean = false) {
			super(lbl, idx, de, lck);
			_index = idx;
			imageLoader = new ImageLoader(160,140,true);
			addChild(imageLoader);
			imageLoader.x = 20;
			addAlphaField(alphaField);
			addViewClip(view);
			addEventListenerOn(imageLoader);
			initView();
			imageLoader.addEventListener(Event.OPEN,onImageOpen);
			imageLoader.addEventListener(Event.COMPLETE, onImageComplete);
			imageLoader.load(_label);
		}
		private function onImageOpen(evt:Event):void{
			this.dispatchEvent(new Event(Event.OPEN,true));
		}
		private function onImageComplete(evt:Event):void{
			this.dispatchEvent(new Event(Event.COMPLETE, true));
		}
		override public function showKey():void{
			addChild(keyoptionmark);
			(keyoptionmark as MovieClip).alpha=1.0;
		}
	}
}
